home *** CD-ROM | disk | FTP | other *** search
- Path: keats.ugrad.cs.ubc.ca!not-for-mail
- From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
- Newsgroups: comp.lang.c,comp.lang.c++,comp.sources.wanted
- Subject: Re: regular expression matching source code
- Date: 22 Feb 1996 11:23:52 -0800
- Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
- Distribution: na
- Message-ID: <4gifs8INN67e@keats.ugrad.cs.ubc.ca>
- References: <DMwHzn.LIF@bcstec.ca.boeing.com>
- NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
-
- In article <DMwHzn.LIF@bcstec.ca.boeing.com>,
- Todd Waetzig <waetzig@bcstec.ca.boeing.com> wrote:
- >I am looking for the 'C' or 'C++' source for a function to
- >perform a match of a string. This function would
- >use the syntax of regular expressions. This regular
- >expression matching would be similar to that used by
- >grep and sed.
- >
- >Ideally it would look something like
- >
- >if (match("^1([A-Z]*|[0-9]*)Z?",string_to_search) == 0)
- > printf("match found ");
-
- That would be far from ideal, unless the match() function was able to keep a
- cache of recently used regular expressions to avoid recompiling the above on
- each invocation.
-
- Regexp matching really requires an interface that separates the expression
- compiler from the finite state machine emulator which executes the match.
-
- Try the regular expression source code in the GNU C library. The freeware UNIX
- variants have to get their regex routines from somwhere!
-
- Chances are, any time you need C code that is normally found in a UNIX
- library, you can find it as freeware code that is part of Linux, FreeBSD et al.
- --
-
-